package com.ruoyi.job.remote.impl;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.job.domain.OaPerson;
import com.ruoyi.job.remote.FeignUserService;
import com.ruoyi.system.api.domain.SysUser;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author wangsr
 * @date 2021-12-30 21:56
 * @description
 */
@Component
public class FeignUserServiceImpl implements FallbackFactory<FeignUserService> {

    @Override
    public FeignUserService create(Throwable cause) {
        return new FeignUserService() {
            @Override
            public AjaxResult syncOaUser(List<OaPerson> oaPeople, String source) {
                return AjaxResult.success(cause.getMessage());
            }
        };
    }
}
